<template>
    <div id='tmpl'>
        <div class="title">
            <h4 v-text="info.title"></h4>
            <p>{{info.add_time | timedmf('YYYY-MM-DD HH:mm:ss')}} {{info.click}}次浏览</p> 
        </div>
        <div id="content" v-html="info.content">

        </div>
        <comment></comment>
    </div>
</template>
<script>
import { Toast } from 'mint-ui';
//引入评论区子组件
import comment from '../../subcom/comment.vue';
export default {
    data() {
        return {
            id: 0,
            info: {}
        };
    },
    components:{
        'comment':comment
    },
    created() {
        this.getList();
    },
    methods: {
        getList() {
            this.id = this.$route.params.getid;
            var url = this.$common.apidomain + '/api/getnew/' + this.id;
            this.$http.get(url).then(function (res) {
                if(res.body.status!==0){
                    Toast(res.body.message);
                    return;
                }
                this.info = res.body.message[0];
                console.log(this.info);
            })
        }
    }
}
</script>
<style lang="css" scoped>
.title h4 {
    color: #0094ff;
}

.title p {
    color: rgba(0, 0, 0, 0.5);
}

.title,
#content {
    padding: 5px;
}
</style>